package com.example.drawscreen;

import android.app.Activity;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

public class SettingActivity extends Activity {

	CheckBox volumnChk1, volumnChk2, screenChk1, screenChk2;
	
	 @Override
	    protected void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.setting);

	        volumnChk1 = (CheckBox)findViewById(R.id.volumnChk1);
	        volumnChk1.setOnCheckedChangeListener(listener);
	        
	        volumnChk2 = (CheckBox)findViewById(R.id.volumnChk2);
	        volumnChk2.setOnCheckedChangeListener(listener);

	        screenChk1 = (CheckBox)findViewById(R.id.screenChk1);
	        screenChk1.setOnCheckedChangeListener(listener);

	        screenChk2 = (CheckBox)findViewById(R.id.screenChk2);
	        screenChk2.setOnCheckedChangeListener(listener);
	 }
	 
	 private OnCheckedChangeListener listener = new OnCheckedChangeListener() {
		 
		 public void onCheckedChanged(CompoundButton arg0, boolean isChecked) {
		 if(isChecked){
		 switch(arg0.getId())
		   {
		     case R.id.volumnChk1:
		    	  volumnChk1.setChecked(true);
		    	  volumnChk2.setChecked(false);
		          break;
		     case R.id.volumnChk2:
		    	  volumnChk1.setChecked(false);
		    	  volumnChk2.setChecked(true);
		          break;
		    case R.id.screenChk1:
		    	 screenChk1.setChecked(true);
		    	 screenChk2.setChecked(false);
		         break;
		    case R.id.screenChk2:
		    	 screenChk1.setChecked(false);
		    	 screenChk2.setChecked(true);
		         break;
		   }
		 }
		 }
	 };
		  
}
